package ldh.im.base.constant;


import ldh.common.mybatis.ValuedEnum;

public enum TerminalType implements ValuedEnum<Byte> {
    pc((byte)0, 805002131),
    android((byte)1, 942188583),
    ios((byte)2, 959862812),
    pad((byte)3, 247314419),
    ipad((byte)4, 409872442),
    web((byte)5, 771876145),
    ;

    private Byte value;
    private int identification;

    private TerminalType(Byte b, int identification) {
        this.value = b;
        this.identification = identification;
    }

    @Override
    public Byte getValue() {
        return value;
    }

    @Override
    public String getDesc() {
        return this.name();
    }

    public int getIdentification() {
        return identification;
    }

    public static TerminalType getByIdentification(int identification) {
        for(TerminalType terminalType : TerminalType.values()) {
            if (terminalType.identification == identification) {
                return terminalType;
            }
        }
        throw new RuntimeException("不支持这种类型：" + identification);
    }
}
